package cn.xiaopengstack.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import cn.xiaopengstack.infrastructure.persistent.po.UserAwardRecord;
import cn.xiaopengstack.infrastructure.persistent.po.UserCreditAccount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
* @author jiangyangang
* @description 针对表【user_credit_account(用户积分账户)】的数据库操作Mapper
* @createDate 2025-07-23 17:54:47
* @Entity cn.xiaopengstack.infrastructure.persistent.po.UserCreditAccount
*/
@Mapper
public interface IUserCreditAccountDao {

    @DBRouter
    int insertSelective(UserCreditAccount record);

    int updateByPrimaryKeySelective(UserCreditAccount record);

    @DBRouter
    int updateCreditAmount(@Param("userId") String userId, @Param("creditAmount") BigDecimal creditAmount);

    @DBRouter(key = "userId")
    UserCreditAccount queryUserCreditAccount(UserCreditAccount userCreditAccount);
}
